<template>
  <div>
    <custom-form
      :columns="columns"
      :rules="rules"
      v-bind="$attrs"
      v-on="listeners"
    >

    </custom-form>
  </div>

</template>

<script>
import customFromMixin from '@/utils/mixin/custom-form'

export default {
  name: 'AddForm',
  mixins: [customFromMixin],
  data() {
    return {
      rules: {},
      // 列配置
      columns: [
        // { name: '名称', field: 'name', opts: { required: true, maxlength: 50 } },
        {
          name: '房号',
          field: 'room.name',
          opts: { control: 'room', name: 'name', required: true },
          type: 'select_table'
        },
        { name: '用水量', field: 'water', opts: { required: true }, type: 'number' },
        { name: '用电量', field: 'power', opts: { required: true }, type: 'number' },

        // { name: '租户', field: 'user.nickname', opts: { control: 'user', label: 'nickname' }, type: 'select_table' },
        {
          name: '状态',
          field: 'status',
          label: false,
          type: 'radio',
          opts: { required: true },
          list: ['未缴费', '已缴费'],
          value: 0
        },
        { name: '日期', field: 'date', type: 'date', opts: { maxlength: 120 } },
        { name: '备注', field: 'mark', type: 'textarea', opts: { maxlength: 120 } }
      ]
    }
  },
  watch: {},
  methods: {}
}
</script>

<style scoped>

</style>
